package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserMapper {


    //1.查询全部
    @Select("Select * from t_user")
    List<User> findAll();

    //2.添加记录
    @Insert("insert into t_user values(null,#{username},#{password},#{remark},#{email})")
    void save(User user);

    //3.删除记录
    @Delete("delete from t_user where id=#{id}")
    void deleteUser(String id);

    //4.更新记录
//    @Update("update t_user set username=#{username},password=#{password},remark=#{remark},email=#{email} where id=#{id}")
    void update(User user);
}
